/* Vault MySQL高并发服务 - 自定义样式 */

/* 全局样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(45deg, #f8f9fa, #e9ecef);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 15px rgba(0, 0, 0, 0.2);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
}

/* 导航栏样式 */
.navbar {
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* 英雄区域样式 */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.feature-card {
    height: 100%;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tech-card {
    height: 100%;
    transition: var(--transition);
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.metric-card {
    background: var(--gradient-secondary);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.metric-card:hover {
    border-left-color: var(--success-color);
}

/* 状态徽章样式 */
.status-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition);
}

.status-badge:hover {
    transform: scale(1.05);
}

/* 按钮样式增强 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 图标样式 */
.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
    transition: var(--transition);
}

.feature-icon:hover {
    transform: rotate(360deg) scale(1.1);
}

/* 架构图样式 */
.architecture-diagram {
    background: var(--light-color);
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.architecture-diagram:hover {
    border-color: var(--primary-color);
    background: #f0f8ff;
}

/* 代码块样式 */
.code-block {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
    position: relative;
    border-left: 4px solid var(--primary-color);
}

.code-block::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 12px;
    height: 12px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 
        -20px 0 0 #fbbf24,
        -40px 0 0 #f87171;
}

/* 手风琴样式 */
.accordion-button {
    font-weight: 600;
    transition: var(--transition);
}

.accordion-button:not(.collapsed) {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* 进度条样式 */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background: var(--gradient-primary);
    transition: width 0.6s ease;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* 表格样式 */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: var(--gradient-primary);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(0, 123, 255, 0.05);
    transform: scale(1.01);
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
    font-weight: 500;
}

.alert-success {
    border-left-color: var(--success-color);
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background: linear-gradient(45deg, #f8d7da, #f5c6cb);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background: linear-gradient(45deg, #fff3cd, #ffeaa7);
}

.alert-info {
    border-left-color: var(--info-color);
    background: linear-gradient(45deg, #d1ecf1, #bee5eb);
}

/* 页脚样式 */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

/* 加载动画 */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滑入动画 */
.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .code-block {
        font-size: 0.8rem;
        padding: 1rem;
    }
    
    .metric-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        margin: 0.2rem;
    }
    
    .architecture-diagram {
        padding: 1rem;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal {
        display: none !important;
    }
    
    .hero-section {
        background: none !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 8px 15px rgba(0, 0, 0, 0.4);
    }
    
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn {
        border-width: 2px;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2d3748;
        --dark-color: #f8f9fa;
    }
    
    body {
        background-color: #1a202c;
        color: var(--dark-color);
    }
    
    .card {
        background-color: #2d3748;
        color: var(--dark-color);
    }
    
    .architecture-diagram {
        background: #2d3748;
        border-color: #4a5568;
    }
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background: var(--dark-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* 选择文本样式 */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}